# -*- coding: utf-8 -*-

import os

import yaml

__SCRIPT_PATH = os.path.abspath(__file__)
__SCRIPT_DIR = os.path.dirname(__SCRIPT_PATH)
PROJECT_DIR = os.path.dirname(__SCRIPT_DIR)
PROJECT_NAME = "fits2h5"
PROJECT_ABBR_NAME = os.path.basename(__SCRIPT_DIR)
SRC_ROOT = os.path.join(PROJECT_DIR, PROJECT_ABBR_NAME)
DATA_DIR = os.path.join(PROJECT_DIR, "data")
CACHE_DIR = os.path.join(PROJECT_DIR, "cache")
LOG_ROOT = os.path.join(CACHE_DIR, "logs")

# noinspection PyTypeChecker

with open(os.path.join(SRC_ROOT, "cfgs", "conf.yaml"), "r", encoding="utf-8") as __fp:
    DEFAULT_DATASET_KWARGS = yaml.safe_load(__fp)["dataset_kwargs"]


if __name__ == "__main__":
    def show_vars():
        print(f"PROJECT_NAME = {PROJECT_NAME}")
        print(f"PROJECT_ABBR_NAME = {PROJECT_ABBR_NAME}")
        print(f"SRC_ROOT = {SRC_ROOT}")
        print(f"DATA_DIR = {DATA_DIR}")
        print(f"CACHE_DIR = {CACHE_DIR}")
        print(f"LOG_ROOT = {LOG_ROOT}")

    show_vars()
